<?php htmlTemplate('admin_header_frame.php');?>
<div class="title">在线时长统计

</div>
<script type="text/javascript">
function checkstype()
{
	notype = $("#notype").val();
	if (notype=='uxin'){
		$(".stype").hide();
	}else{
		$(".stype").show();
	}
}
</script>
<table width="100%" cellspacing="1" cellpadding="3" id="listTable">
  <tbody>
  <!-- 搜索开始 -->
  <!-- 
  <tr>
	<td colspan="7">
	<form action="">	
	<select name="notype" id="notype" onchange="checkstype()">
		<option value="uxin">有信ID</option>
		<option value="mobile">手机号</option>
	</select>
	<input type="text" name="uid" id="uid" value="<?php echo Http::get('uid');?>"/>
	<span class="stype" style="<?php if (Http::get('notype')=='uxin' or !Http::get('notype')){echo 'display:none';}?>">
	平台：
	<select name="stype" id="stype">
		<?php 
		if (Http::get('stype')=='0'){
			echo '<option value="'.Http::get('stype').'">所有</option>';
		}
		if (Http::get('stype')){
			echo '<option value="'.Http::get('stype').'">'.Http::get('stype').'</option>';
		}
		?>
		<?php 
		if (Http::get('stype')!='0'){?>
		<option value="0">所有</option>
		<?php }?>
		<option value="alluser">alluser</option>
		<option value="iphone">iphone</option>
		<option value="android">android</option>
		<option value="syms60v5">syms60v5</option>
		<option value="vip">vip</option>
	</select>
	</span>
	日期:			
	<input 
		id="stimeline" 
		name="stimeline" 
		type="text" 
		style="width:85px;"
		value='<?php 
		if (Http::get('stimeline')){
			echo Http::get('stimeline');
		}
		?>' class='date demo_time'  
		onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH'})"
		>-<input 
		id="etimeline" 
		name="etimeline" 
		type="text" 
		style="width:85px;"
		value='<?php 
		if (Http::get('etimeline')){
			echo Http::get('etimeline');
		}
		?>' class='date demo_time'  
		onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH'})"
		>
	<input type="submit" value="搜 索" class="btn"> 
	
	</form>
	</td>
  </tr>
   -->
  <!-- 搜索结束 -->
  <tr>
  	<th align="center">手机类型</th>
  	<th align="center">网络类型</th>
    <th align="center">当天离线<br>用户数</th>
    <th align="center">当天离线<br>用户总时长</th>
    <th align="center">当天在线<br>用户数</th>
    <th align="center">当天在线<br>用户总时长</th>
    <th align="center">当天之前上线到现在<br>没有退出用户数</th>
    <th align="center">当天之前上线到现在<br>没有退出总时长</th>
    <th align="center">总用户数</th>
    <th align="center">总在线时长</th>
    <th align="center">平均<br>在线时长</th>
  </tr>
 
	<?php 
	foreach ($rs as $k=>$v):
	?>
   <tr>
   	<td align="center"><?php 
   	if($v['phonetype']=='1') echo 'Android';
   	if($v['phonetype']=='2') echo 'Symbian';
   	?></td>
   	<td align="center"><?php 
   	if($v['netstate']=='1') echo 'Wifi';
   	elseif($v['netstate']=='2') echo '2G';
   	elseif($v['netstate']=='3') echo '3G';
   	else echo '未知';
   	?></td>
   	<td align="center"><?php echo $v['offlineCountPhone'];?></td>
   	<td align="center"><?php echo ceil($v['offlineCount']/60);?></td>
   	<td align="center"><?php echo $v['onlineCountPhone'];?></td>
   	<td align="center"><?php echo ceil($v['todayOnlineCount']/60) ;?></td>
   	<td align="center"><?php echo $v['befOnlineCountPhone'];?></td>
   	<td align="center"><?php echo ceil($v['befDayOnlineCount']/60);?></td>
   	<td align="center"><?php echo $v['offlineCountPhone']+$v['onlineCountPhone']+$v['befOnlineCountPhone'];?></td>
   	<td align="center"><?php echo ceil(($v['offlineCount']+$v['todayOnlineCount']+ $v['befDayOnlineCount'])/60);?></td>
    <td align="center"><?php echo ceil(($v['offlineCount']+$v['todayOnlineCount']+ $v['befDayOnlineCount'])/60/($v['offlineCountPhone']+$v['onlineCountPhone']+$v['befOnlineCountPhone']));?></td>
    
  </tr>
  <?php endforeach;?>
 
 
 
  </tbody>
</table>
<?php htmlTemplate('admin_footer_frame.php');?>